/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package logica;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author andresgodoysalavert
 */
public class Cliente {

    private int id;
    private String nombre;
    private String contrasena;
    private Connection conexion;



    public void getContrasenaCliente() throws SQLException{
        ConexionBD c = new ConexionBD();
        conexion = c.conectarBD();
        String query = "SELECT contrasena FROM clientes WHERE id=1";
        PreparedStatement ps = conexion.prepareStatement(query);
        ResultSet rs = ps.executeQuery();
        this.setContrasena(rs.getString(1));
        conexion.close();
    }

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the nombre
     */
    public String getNombre() {
        return nombre;
    }

    /**
     * @param nombre the nombre to set
     */
    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    /**
     * @return the contrasena
     */
    public String getContrasena() {
        return contrasena;
    }

    /**
     * @param contrasena the contrasena to set
     */
    public void setContrasena(String contrasena) {
        this.contrasena = contrasena;
    }

}
